/*
 * player.c
 */

#include <gamelogic/npc.h>
#include "player.h"

static unit *player;
static void *player_stats;

/*
 * Creates the player unit at the given location, returning a pointer to the
 * corresponding unit struct.
 */
unit * player_create( unsigned long x, unsigned long y, unsigned long z,
    const char *name, void *stats ) {
    player = npc_create(x, y, z, name, stats);
    player_stats = stats;
    return player;
}

/*
 * Returns the current player as a pointer to a unit.
 */
unit * player_get() {
    return player;
}

/*
 * Returns the x value of the player's current position.
 */
unsigned int player_get_x() {
    return player->x;
}

/*
 * Returns the y value of the player's current position.
 */
unsigned int player_get_y() {
    return player->y;
}

/*
 * Returns the z value of the player's current position.
 */
unsigned int player_get_z() {
    return player->z;
}
